/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package command.linux;

import java.io.IOException;

import command.Command;

/**
 * 
 * @author Yang Wang <yang@digitalmenubox.com>
 */
public class setVolume implements Command {

	public static final int MINIMUM = 0;
	public static final int MAXIMUM = 64;

	@Override
	public void execute(String[] args) throws IOException {
		int volume = Integer.parseInt(args[0]);
		if (volume < MINIMUM) {
			volume = MINIMUM;
		}
		if (volume > MAXIMUM) {
			volume = MAXIMUM;
		}
		Process p = Runtime.getRuntime().exec("amixer set Master " + volume);
	}
}
